---
title: Firecrawl Reader
---

The **Firecrawl Reader** uses the Firecrawl API to scrape and crawl web content, converting it into documents for your knowledge base.

## Code

```python examples/concepts/knowledge/readers/firecrawl_reader.py
import os

from agno.knowledge.reader.firecrawl_reader import FirecrawlReader

api_key = os.getenv("FIRECRAWL_API_KEY")

reader = FirecrawlReader(
    api_key=api_key,
    mode="scrape",
    chunk=True,
    # for crawling
    # params={
    #     'limit': 5,
    #     'scrapeOptions': {'formats': ['markdown']}
    # }
    # for scraping
    params={"formats": ["markdown"]},
)

try:
    print("Starting scrape...")
    documents = reader.read("https://github.com/agno-agi/agno")

    if documents:
        for doc in documents:
            print(doc.name)
            print(doc.content)
            print(f"Content length: {len(doc.content)}")
            print("-" * 80)
    else:
        print("No documents were returned")

except Exception as e:
    print(f"Error type: {type(e)}")
    print(f"Error occurred: {str(e)}")
```

## Usage

<Steps>
  <Snippet file="create-venv-step.mdx" />

  <Step title="Install libraries">
    ```bash
    pip install -U firecrawl-py agno
    ```
  </Step>

  <Step title="Set API Key">
    ```bash
    export FIRECRAWL_API_KEY="your-firecrawl-api-key"
    ```
  </Step>

  <Step title="Run Agent">
    <CodeGroup>
    ```bash Mac
    python examples/concepts/knowledge/readers/firecrawl_reader.py
    ```

    ```bash Windows
    python examples/concepts/knowledge/readers/firecrawl_reader.py
    ```
    </CodeGroup>
  </Step>
</Steps>

## Params

<Snippet file="firecrawl-reader-reference.mdx" />

  